package com.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.entity.ResolutionEntity;

@Repository
public class ResolutionDaoImpl extends GenericDaoImpl<ResolutionEntity> implements ResolutionDao {

	public ResolutionEntity getResolutionById(int id) {
		return getById(ResolutionEntity.class, id);
	}

	public List<ResolutionEntity> getAllResolution() {
		return getAll(ResolutionEntity.class);
	}

	public ResolutionEntity getResolutionByUniqueId(String id) {
		String hql = "From ResolutionEntity where id =:id";
		Query query = sessionFactory.getCurrentSession().createQuery(hql);
		query.setParameter("id",id);
		return (ResolutionEntity) query.uniqueResult();
	}


}
